# Maintainer: Florian Pritz <bluewind@xinu.at>
# Contributor: Kevin Piche <kevin@archlinux.org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=zim
pkgver=0.75.1
pkgrel=2
pkgdesc="A WYSIWYG text editor that aims at bringing the concept of a wiki to the desktop."
arch=(any)
license=('GPL' 'PerlArtistic')
url="https://zim-wiki.org/"
depends=('python' 'python-gobject' 'ttf-font' 'gtk3' 'python-xdg')
checkdepends=('xorg-server-xvfb')
optdepends=('bzr: Version Control plugin'
            'git: Version Control plugin'
            'mercurial: Version Control plugin'
            'gnuplot: Insert Gnuplot plugin'
            'ditaa: Insert Ditaa plugin'
            'graphviz: Insert Diagram plugin'
            'xdot: Link Map plugin'
            'gtkspell3: Spell Checker plugin'
            'r: Insert GNU R Plot plugin'
            'scrot: Insert Screenshot plugin'
            'lilypond: Insert Score plugin'
            'gtksourceview3: Source View plugin'
            'texlive-bin: Insert Equation plugin')
source=("https://www.zim-wiki.org/downloads/${pkgname}-${pkgver}.tar.gz")
sha256sums=('88e175d7f7e141896f9e958989d252d722556af17bc4bc6f065e7d54287d0385')

check() {
	cd "${srcdir}/${pkgname}-${pkgver}"

	xvfb-run -w0 ./test.py
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"

	python setup.py install --root="${pkgdir}" --optimize=1

	install -dm755 "$pkgdir/usr/share/icons/"
	cp -r xdg/hicolor/ "$pkgdir/usr/share/icons/"
}
